/**
 * 加载登录页面
 */
$(function () {

});


//清除谷歌浏览器缓存cookie
function cleanCookie() {
    console.log(this);
    if(navigator.userAgent.toLowerCase().indexOf('chrome') > 0){
        var _interval = window.setInterval(function () {
           var autoFiles = $('input:-webkit-autofill');
           if(autoFiles.length > 0){
               window.clearInterval(_interval);
               autoFiles.each(function () {
                   var clone = $(this).clone(true,true);
                   $(this).after(clone).remove();
               });
           }
        },0)
    }
}
/*

var errormsg = "";
var loginAction = wwwroot;
var init=function() {
    var url = location.search; //获取url中"?"符后的字串
    if (url.indexOf("?") != -1) {
        errormsg = "登录信息错误，请重新登录！";
    }
    //如果不是父页面，刷新到顶层页面，避免出现网页中内嵌登录页面
    if (window.parent != window) {
        window.parent.location.reload();
    }

    if (($cookieStore.get("remember_me") == "true") || ($cookieStore.get("remember_me") == true)) {
        $scope.username = $cookieStore.get("j_username");
        $scope.password = $cookieStore.get("j_password");
        $scope.remember = true;
    } else {
        $scope.remember = false;
    }

    //回车事件
    document.onkeydown = function (evt) {
        var evt = window.event ? window.event : evt;
        if (evt.keyCode == 13) {
            $scope.login();
        }
    };
};

/!**
 * 登录时验证，验证通过后记录cookie
 *!/
var login = function(){
    if ($scope.remember) {
        $cookieStore.put("remember_me", $scope.remember); // 存储 cookie
        $cookieStore.put("j_username", $scope.username); // 存储 cookie
        $cookieStore.put("j_password", $scope.password); // 存储 cookie
    }else {
        $cookieStore.remove("remember_me");
        $cookieStore.remove("j_username");
        $cookieStore.remove("j_password");
    }

    //登录
    if($scope.loginForm.$valid){
        $scope.loginAction = wwwroot + "/j_login";
        //$scope.loginForm.submit();
    }
}*/
